package com.zhuss.controller.food;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zhuss.bean.bo.food.order.DetailOrderBo;
import com.zhuss.bean.bo.food.order.wechat.ListOrderBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.ReadService;
import com.zhuss.exception.WpsException;
import com.zhuss.food.order.OrderReadServiceExt;
import com.zhuss.food.order.OrderReadServiceWechat;


/**
 * 订单查询 controller
 * @Author zhushanshuo
   @Date 2020/03/11 16:01
 *
 */
  
 
@RestController
@RequestMapping("/order")
public class OrderReadController extends BaseController {
	
	@Autowired
	@Qualifier("orderReadService")
	private ReadService<Object, Object> orderReadService;
	
	@Autowired
	@Qualifier("orderReadServiceExt")
	private OrderReadServiceExt orderReadServiceExt;
	
	@Autowired
	@Qualifier("orderReadServiceWechat")
	private OrderReadServiceWechat orderReadServiceWechat;
	
	/**
	 * 详情
	 * @param bo
	 * @return
	 * @throws WpsException
	 */
	@ResponseBody
	@RequestMapping("/detail")
    public Object detail(@RequestBody DetailOrderBo bo) throws WpsException {
		
		Object result = orderReadServiceWechat.detailWechat(bo);
		return result;
    }
	
	/**
	 * 列表
	 * @param bo
	 * @return
	 * @throws WpsException
	 */
	@ResponseBody
    @RequestMapping("/list")
    public Object list(@RequestBody ListOrderBo bo) throws WpsException {
		
		Object result = orderReadServiceWechat.listWechat(bo);
		return result;
    }
	
}
